using System.Collections.Generic;

namespace JGSY.CourseManagement.Infrastructure.Configuration
{
    /// <summary>
    /// 配置服务接口，提供应用程序配置的读取、写入和持久化功能
    /// </summary>
    public interface IConfigurationService
    {
        /// <summary>
        /// 从配置中获取指定键的值
        /// </summary>
        /// <typeparam name="T">值的类型</typeparam>
        /// <param name="key">配置键</param>
        /// <returns>配置值</returns>
        T GetValue<T>(string key);
        /// <summary>
        /// 设置配置中指定键的值
        /// </summary>
        /// <typeparam name="T">值的类型</typeparam>
        /// <param name="key">配置键</param>
        /// <param name="value">要设置的值</param>
        void SetValue<T>(string key, T value);
        /// <summary>
        /// 将当前配置保存到持久化存储
        /// </summary>
        void Save();
        /// <summary>
        /// 从持久化存储加载配置
        /// </summary>
        void Load();
    }
}